$(document).ready(function(){
	$(".a").blur(function(){
		alert("a");
		setDivCenter();
	});
	
	
	
	$("input:first").blur(function(){
		var data;
		var bigCat=$("#attrName").text();
		bigCat=bigCat+":"
		data=$(this).val();
		//setDivCenter(); 如果需要图片，则把注释去掉
		$.ajax({
            type: "Post",
            url: "http://localhost:8080/jxsdmarket/user/publish_querycralData.action",   /*注意，这里开始是提交的服务器路径*/
            cache:false,
            data: {"data":data},
            timeout: 2000,
            success: function(data) {
            	autoGet(data);
            },

            error: function(err) {
                alert("网络连接不稳定，请重新刷新一次！");
            }
        });
	});
	
	
	function getISBN(){
		var isbn;
		isbn=$('.line').next().val();
		alert(isbn);
	}
	
	
	function setDivCenter(){     
	    var top = ($(window).height() - $("#loading").height())/2;     
	    var left = ($(window).width() - $("#loading").width())/2;     
	    var scrollTop = $(document).scrollTop();     
	    var scrollLeft = $(document).scrollLeft();     
	    $("#loading").css( { 'top' : top + scrollTop, left : left + scrollLeft } ).show();    
	}  
	
	
	function autoGet(data){
		var array=data.split("*#*");
		
		$.each(array,function(key,value){
			var id=key+1;
			var se="#"+id;
			if(array.length-1!=key){
				$(se).val(value);
			}
		});
	    
		var ck_content=array[array.length-1];
		$('#editor1').val(ck_content);
		location.reload();
	}
	
	
});